<!--首页-排行榜-->
<template>
  <div class="ranking" v-if="rankings && rankings.length" @click="click">
          
    <div class="ranking2">
      <div class="ranking2" v-if="rankings[1]">
        <LImage class="img-bg" :src="Config.img('v2_2_bg.png')"></LImage>
        <div class="head2 head-size2">
          <LImage class="head-size2 absolute" :src="Config.img('view_image_portrait_normal.png')"></LImage>
          <LImage class="head-size2" :src="rankings[1].avatar"></LImage>
        </div>
        <text class="font24 text2 text">{{rankings[1].nickName}}</text>
        <text :class="['font28', Config.upDownFont(rankings[1].realYearIncome)]">{{rankings[1].realYearIncome+'%'}}</text>
      </div>
    </div>

    <div class="ranking1">
      <div class="ranking1" v-if="rankings[0]">
        <LImage class="img-bg" :src="Config.img('v2_1_bg.png')"></LImage>
        <div class="head1 head-size1">
          <LImage class="head-size1 absolute" :src="Config.img('view_image_portrait_normal.png')"></LImage>
          <LImage class="head-size1" :src="rankings[0].avatar"></LImage>
        </div>
        <text class="font28 text2 text">{{rankings[0].nickName}}</text>
        <text :class="['font32', Config.upDownFont(rankings[0].realYearIncome)]">{{rankings[0].realYearIncome+'%'}}</text>
      </div>
    </div>

    <div class="ranking2">
      <div class="ranking2" v-if="rankings[2]">
        <LImage class="img-bg" :src="Config.img('v2_3_bg.png')"></LImage>
        <div class="head2 head-size2">
          <LImage class="head-size2 absolute" :src="Config.img('view_image_portrait_normal.png')"></LImage>
          <LImage class="head-size2" :src="rankings[2].avatar"></LImage>
        </div>
        <text class="font24 text2 text">{{rankings[2].nickName}}</text>
        <text :class="['font28', Config.upDownFont(rankings[2].realYearIncome)]">{{rankings[2].realYearIncome+'%'}}</text>
      </div>
    </div>
  </div>
</template>

<style src="@/_css/style.css" ></style>
<style scoped>
.ranking{
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-end;
}
.text{
  text-align: center;
  width: 160px;
  lines: 1;
  text-overflow: ellipsis;
}
.img-bg{
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.ranking1{
  flex-direction: column;
  align-items: center;
  width: 238px;
  height: 302px;
}
.head1 {
  border-radius: 88px;

  margin-top: 80px;
  margin-bottom: 10px;
}
.head-size1 {
  width: 88px;
  height: 88px;
}

.ranking2{
  flex-direction: column;
  align-items: center;
  width: 222px;
  height: 238px;
}
.head2 {
  overflow: hidden;

  border-radius: 88px;

  margin-top: 57px;
  margin-bottom: 14px;
}
.head-size2 {
  width: 56px;
  height: 56px;
}
</style>

<script>
import jconfig from "@/_js/config";

export default {
  
  props:{
    rankings:{
      type:Array,
      default:undefined,
    },
  },

  data() {
    return {
      Config:jconfig,
    };
  },

  created() {
  },

  methods: {
    /********************************** 点击触发*/
    //排行榜点击
    click(){
      this.$emit("click");
    }
  }
}
</script>

